<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="keywords" th:content="${config.keywords}">
    <meta name="description" th:content="${config.decText}">
    <link rel="shortcut icon" id="favicon" href="/static/favicon.ico"/>
    <title th:text="${config.siteName}"></title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/font-awesome.min.css" rel="stylesheet">
    <link href="/static/css/index2.css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>
<body id="home">
<section id="services" style="padding: 00px;">
    <div class="login_container panel ">
        <div class="login_header">
            <h1 style="text-align: center;" th:text="${config.siteName} + ' - 软件授权'">
            </h1>
        </div>
        <div class="login_box" style="padding: 00px;">
            <div class="login_box_main">
                <span style="color: green;text-align: center;" th:text="'注册码无效或已过期,域名:'+${host}"> </span>
                <form class="registerform" id="registerform" onsubmit="return false;" method="post">
                    <p class="input_box">
                        <input type="text" autocomplete="off" value="${config.authCode!}" datatype="m" id="email" name="email"
                               placeholder="请输入软件注册码" class="user_name input1" required>
                    </p>
                    <p class="login_btn">
                        <button id="post_reg" style="width:100%;" type="button" onclick="submit_reg(this)"
                                ng-disabled='form.$invalid'>
								<span>注册</span>
                        </button>
                    </p>

                </form>
            </div>
        </div>
    </div>
</section>
</body>
<script src="/static/lib/layui/layui.js" charset="utf-8"></script>

<script>
    /**
     * 发送邮件验证码
     */
    function submit_reg(obj) {
        var code = $("#email").val();
        layer.msg("正在认证,请稍后...", {icon: 16, shade: 0.01, time: 1500000});
        $.post("/auth_reg_submit",
            {"code": code},
            function (data) {
                if (data.code ==0){
                    layer.msg(data.msg);
                    setTimeout(function () {
                        window.location = "/?spm="+new Date().getTime();
                    },500);
                }else{
                    layer.msg(data.msg);
                }
            }, "json");
    }

</script>
</html>